<template>
  <div class="content">
    <div class="md-layout">
      <div id="fenkai" class="md-layout-item md-medium-size-100 md-xsmall-size-100 md-size-100">
        <div class="md-layout-item md-size-100 text-right" style="margin-bottom:20px;">
          <md-button class="md-raised md-success" v-on:click="saveClick">保存</md-button>
          <md-button class="md-raised md-success" v-on:click="show">show</md-button>
        </div>
        <base-edit data-background-color="green" :formdata="baseinfo"></base-edit>
        <customer-edit data-background-color="green" :formdata="customerinfo"></customer-edit>
        <cautionere-edit data-background-color="green" :formdata="customerinfo"></cautionere-edit>
        <emergency-edit data-background-color="green" :formdata="customerinfo"></emergency-edit>
      </div>
    </div>
  </div>
</template>

<script>

import BaseEdit from '@/views/Common/BaseEdit.vue'
import CustomerEdit from '@/views/Common/CustomerEdit.vue'
import CautionerEdit from '@/views/Common/CautionerEdit.vue'
import EmergencyEdit from '@/views/Common/EmergencyEdit.vue'

export default{
  components: {
    'base-edit': BaseEdit,
    'customer-edit': CustomerEdit,
    'cautionere-edit': CautionerEdit,
    'emergency-edit': EmergencyEdit
  },
  data () {
    return {
      applycd: '',
      baseinfo: {},
      customerinfo: {},
      comments: {},
      logs: {}
    }
  },
  mounted: function () {
    this.applycd = this.$route.params.id

    if (this.applycd !== 'new') {
      // let tmp =  this.$store.mcode.getters.getcode('aaa')
      // alert(tmp)
      // var _this = this
      // this.$http({
      //   method: 'post',
      //   url: 'http://localhost:9090/article/test/listApply',
      //   dataType: 'json',
      //   data: {applycd: this.applycd}
      // }).then(function (res) {
      //   // alert(JSON.stringify(res.data.returnData));
      //   console.log(res.data.returnData.list)
      //   // Vue.set(data,'applylist', res.data.returnData.list)
      //   _this.baseinfo = res.data.returnData.list[0]
      // })
    } else {
      this.baseinfo = {}
    }
  },
  methods: {
    saveClick: function () {

    },

    show: function () {
      // console.log(this.$root.mycode.getMList('29'))

      alert(this.baseinfo.finProductId)
    }
  }
}
</script>
<style>
  #fenkai>form .md-field{padding-top:16px;margin:4px 0 4px;}
  #fenkai>form .md-card{margin:4px 0;}
  #fenkai>form .md-card .md-card-header {padding:8px;}
  #fenkai>form .md-card .title {margin-top: 0;
    margin-bottom: 0;}
  #fenkai>form select{width:100%}
  #fenkai>form .md-field.myradio:after{background-color:#FFFFFF !important}
  #fenkai>form .md-field.myradio{margin-top: 5px;padding-top:22px;}
</style>
